#概括性统计量
x <- sample(x=1:100,size = 100,replace = TRUE)
print(x)
print(mean(x))
y <- x
y[sample(x=1:100,size = 20,replace = FALSE)] <- NA
print(y)
print(mean(y))
print(mean(y,na.rm = TRUE))
grade <- c(95,72,87,66)
print(grade)
weights <- c(1/2,1/4,1/8,1/16)
print(weights)
print(mean(grade))
#计算加权平均数
print(weighted.mean(x=grade,w=weights))
#方差
print(var(x))
print(sum((x-mean(x))^2)/(length(x)-1))
#标准差
print(sqrt(var(x)))
print(sd(x))
print(sd(y))
print(sd(y,na.rm = TRUE))
print(min(x))
print(max(y))
print(median(x))
print(min(y))
print(min(y,na.rm = TRUE))
print(summary(x))
print(summary(y))
print(quantile(x,probs = c(.25,.75)))
print(quantile(y,probs = c(.25,.75),na.rm = TRUE))
print(quantile(x,probs = c(.1,.25,.5,.75,.99)))

